package org.example.game.history;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/05/19 10:37
 */
public class Solution100310 {

    public static void main(String[] args) {
        Solution100310 solution100310 = new Solution100310();
        System.out.println(solution100310.isArraySpecial(new int[]{4,3,1,6}));
    }

    public boolean isArraySpecial(int[] nums) {
        if(nums.length == 1){
            return true;
        }
        boolean ou;
        for(int i=1;i<nums.length;i++){
            ou = nums[i-1]%2 == 0;
            if((nums[i]%2 == 0 && ou) || (nums[i]%2 != 0 && !ou)){
                return false;
            }
        }
        return true;
    }

}
